'use strict';
module.exports = {
	/**
	 * 修改文章
	 * @url admin/article/sys/update 前端调用的url参数地址
	 * data 请求参数 说明
	 * @param {String} _id  ID
	 * @param {Number} status 状态  0审核中  1通过  2拒绝  3下架
	 * @param {String} remark 备注
	 */
	
	main: async (event) => {
		let { data = {}, userInfo, util, filterResponse, originalParam } = event;
		let { customUtil, uniID, config, pubFun, vk, db, _ } = util;
		let { uid } = data;
		let res = { code: 0, msg: "" };
		// 业务逻辑开始-----------------------------------------------------------
		let { _id } = data;
		
		delete data["pl_table_level"];
		delete data["userInfo"];
		delete data["uid"];
		
		let dbName = "db-article";

		res.num = await vk.baseDao.updateById({
			dbName,
			id: _id,
			dataJson: data
		})
		// 业务逻辑结束-----------------------------------------------------------
		return res;
	}
}
